home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / basic / blitzgtfix.lha / BlitzGTFix / BBGTLib_Examples / gtpalette.bb2 < prev    next >
Text File  |  2002-01-27  |  822b  |  37 lines

  1. WbToScreen 3
  2. Use Screen 3
  3.  
  4. LoadFont 2,"opal.font",9
  5. Use IntuiFont 2
  6.  
  7.  
  8. ; DONT USE COMMANDS WHICH USE A3 AS A PARAMETER DIRECTLY WITH HEX$
  9. ; COS IT GOES SCREWY
  10.  
  11. foo.l=GTPalette(0,1,20,20,150,20,"Normal",#PLACETEXT_ABOVE,4)
  12. NPrint Hex$(foo)
  13.  
  14. foo.l=GTPalette(0,2,20,60,150,20,"Disabled",#PLACETEXT_ABOVE|$40,4)
  15. NPrint Hex$(foo)
  16.  
  17. GTTags #GTPA_IndicatorWidth,1   ; Need to specify an indicator width to be able to see the selected colour
  18. foo.l=GTPalette(0,3,20,100,150,20,"Colour",#PLACETEXT_ABOVE,4,3)
  19. NPrint Hex$(foo)
  20.  
  21. AddIDCMP #PALETTEIDCMP
  22.  
  23. Window 0,0,0,600,300,$100f,"jjlk",-1,-1
  24. DefaultOutput
  25.  
  26. AttachGTList 0,0
  27. While ev.l<>#IDCMP_CLOSEWINDOW
  28.     ev.l=WaitEvent
  29.     Select ev
  30.         Case #IDCMP_GADGETUP
  31.             NPrint "Palette ",GadgetHit," hit, colour ",EventCode," selected"
  32.     End Select
  33. Wend
  34. DetachGTList 0
  35. End
  36.  
  37.